package me.freesoft.distributioin;

public class PmtDemo {

 
	
	
	public static void main(String[] args) {
		System.out.println(PMT(15,36,100000));
	}
	
	 
	
	
	
	public static double PMT(double yearlyInterestRate, int totalNumberOfMonths, double loanAmount)
	{
	    double rate = (double) yearlyInterestRate / 100 / 12;
	    double denominator = Math.pow((1 + rate), totalNumberOfMonths) - 1;
	    return (rate + (rate/denominator)) * loanAmount;
	}
}
